// pages/zhutiyanshou/uploadHouse/uploadHouse.js
// pages/page/home/home.js
const app = getApp();
var sMD5 = require('../../../utils/spark-md5.js')
Page({
  /**
   * 首页
   */
  data: {
    guid:'',
    houseinfodata:{},//获取到的住户总数据     
    projectinfodata:{},//获取到的工程总数据
    recordDatas:[],//现场实景img总数据
    jupaiDatas:{},//现场实景举牌数据
    pdfDatas:[],//pdf文件列表 总数据
    comUrl:'',//文件访问公共地址
    tabs: ['主体验收', '竣工验收'],
    sjcurrent:0, //现场实景 下标
    bgcurrent:0, //验收报告 下标,
    hiddenmodalput: true,
    addRoomName:'' //新增厅室明称
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    this.setData({
      comUrl: app.globalData.fileUrl
    });
     //测试的数据  
    //9fdda666-c04c-40a0-a330-98df0901febd  // 线上环境 
    //ff4256df-95cd-4add-9420-d262aae4a21b 本地环境
    //options.guid='39020408-f0ac-49ee-9901-160adce5db8c';
    if(options.guid!=null && options.guid.length>0){
        that.setData({
          guid: options.guid
        });
        this.initPages();
    }else{
      wx.showToast({
        title: '请先扫描分享码',
        icon: 'none',
        duration: 2000
      });
         /*
         setTimeout(function () {
         wx.reLaunch({
            url: '../scan/scan'
          });
        }, 1000);*/
    }
  },

//初始化数据
  initPages:function(){
    if (app.globalData.userInfo != "null"){
      this.gethouseInfoData();
    }
  },
  //初始住户信息
  gethouseInfoData:function(){
    var that = this;
    wx.request({
      url: app.globalData.url + '/getAllHouseHoldInfo.do',
      method: "POST",
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      data: {
        guid: that.data.guid
      },
      success: function (res) {
        if (res.data.code==200){
          that.getRoomInfoData();
          that.getPdfInfoData();
          that.setData({
            houseinfodata: res.data.data.housedata,
            projectinfodata:res.data.data.sprodata
          });
        }else{
          wx.showToast({
            title: '暂无数据',
            icon: 'none',
            duration: 2000
          })
          that.setData({
            houseinfodata: [],
            projectinfodata:[]
          })
        }
      }
    })
  },
  //获取厅室的信息  及上传的img 
  getRoomInfoData:function(){
    var that = this;
    that.getRoomJupaiInfoData();
    wx.request({
      url: app.globalData.url + '/getHallRoomPagesInfo.do',
      method: "POST",
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      data: {
        acceptanceType:that.data.sjcurrent+1,
        guid: that.data.guid
      },
      success: function (res) {
        if (res.data.code==200){
          that.setData({
            recordDatas:res.data.data
          })
        }else{
          wx.showToast({
            title: '暂无数据',
            icon: 'none',
            duration: 2000
          })
          that.setData({
            recordDatas:[]
          })
        }
      }
    })
  },

 //获取举牌验收信息
 getRoomJupaiInfoData:function(){
    var that = this;
    wx.request({
      url: app.globalData.url + '/findJupaiAvbaseByAcceptanceType.do',
      method: "POST",
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      data: {
        acceptanceType:that.data.sjcurrent+3,
        guid: that.data.guid,
      },
      success: function (res) {
        if (res.data.code==200){
          that.setData({
            jupaiDatas:res.data.data
          })
        }else{
          that.setData({
            jupaiDatas:{}
          })
        }
      }
    })
  },
//现场实景 tab选择
  photoTabSelect:function(e){
    var current = e.currentTarget.dataset.id;
    
    //带动pdf选择标
    this.setData({
      sjcurrent:current,
      bgcurrent:current
    })
    this.getRoomInfoData();
    this.getPdfInfoData();
  },


  getPdfInfoData:function(){
    var that = this;
    wx.request({
      url: app.globalData.url + '/getRecordsByhouseHallGuid.do',
      method: "POST",
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      data: {
        guid: that.data.guid,
        type:that.data.bgcurrent+1,
      },
      success: function (res) {
        if (res.data.code==200){
          that.setData({
            pdfDatas: res.data.data,
          })
        }else{
          that.setData({
            pdfDatas: [],
          })
        }
      }
    })
  },
  //pdf 顶部类型选择框
  pdfTabSelect:function(e){
    var current = e.currentTarget.dataset.id;
    this.setData({
      bgcurrent:current
    })
    this.getPdfInfoData();
  },


  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    this.initPages();
    setTimeout(function () {
      // 不加这个方法真机下拉会一直处于刷新状态，无法复位
      wx.stopPullDownRefresh()
    }, 1000)
  },
//查看 户型图
   hxtImgView: function(e){
    var that=this;
    var imgArrays = [that.getComonUrl(2,that.data.houseinfodata.h_Id)];
    var url=that.getComonUrl(2,that.data.houseinfodata.h_Id);
    wx.previewImage({
     current: url, 
     urls: imgArrays 
    })
  },

  //查看举牌img
  jupaiImgView: function(){
    var that=this;
    var url=that.getComonUrl(1,that.data.jupaiDatas.avb_SliceName,that.data.jupaiDatas.avb_Id);
    var imgArrays = [url];
    var url=url;
    wx.previewImage({
     current: url, 
     urls: imgArrays 
    })
  },

//查看 验收上传的img
  xcsjImgView: function(e){
    var that=this;
    var imgArrays = [];
    var url;
    var listindex=e.currentTarget.dataset.listindex; //list 数据的下标
    var avbindex=e.currentTarget.dataset.avbindex;//当前点击的照片下标
    var list=that.data.recordDatas[listindex].list1;
    if(list.length==0){
      return;
    }
    for(var i=0;i<list.length;i++){
      if(list[i]!=null || list[i] ==undefined || list[i]==""){
        if(list[i].avb_Id!=null && list[i].avb_Id>0){
          if(i==avbindex){
            url=that.getComonUrl(1,list[i].avb_SliceName,list[i].avb_Id);
          }
          imgArrays.push(that.getComonUrl(1,list[i].avb_SliceName,list[i].avb_Id));    
        }
      }
    }
    wx.previewImage({
      current: url, // 当前显示图片的http链接
      urls: imgArrays // 需要预览的图片http链接列表
    })
  },
  //查看 pdf  img文件版
  showPdf: function (e) {
    var that=this;
    var index=e.currentTarget.dataset.listindex;
    var recordindex=e.currentTarget.dataset.recordindex;
    var info=that.data.pdfDatas[index];
    var imgArrays = [];
    var url;
    for(var i=1;i<=info.record_PdfPage;i++){
      if(recordindex==i){
        url=that.getComonUrl(3,info.record_SliceId,info.record_Id,i);
      }
      imgArrays.push(that.getComonUrl(3,info.record_SliceId,info.record_Id,i));    
    }
    wx.previewImage({
      current: url, // 当前显示图片的http链接
      urls: imgArrays // 需要预览的图片http链接列表
    })
  },
//查看pdf
  /*showPdf: function (e) {
    var index=e.currentTarget.dataset.index;
    var info=this.data.pdfDatas[index];
    var url= this.getComonUrl(3,info.record_SliceId,info.record_Id);
      //打开pdf文件
      wx.showLoading({
        title: '加载中...',
      })
      wx.downloadFile({
        url: url,
        success: function (res) {
          const filePath = res.tempFilePath
          wx.openDocument({
            filePath: filePath,
            success: function (res) {
              wx.hideLoading()
            },
            fail: function (res) {
              wx.hideLoading();
              wx.showToast({
                title: '文档不存在,打开失败.',
                icon: 'none',
                duration: 2000
              })
            },
          })
        }
      })
  },*/

  // 选择并上传 平面户型图
  handleUploadImg: function() {
    const that = this;
    // 从相册或相机拍摄
    wx.chooseMedia({
      mediaType: 'image',
      sourceType: ["album", "camera"], // PC端无效
      count: 1,//最多可选择的图片数量
      sizeType: ["original"], //不图片压缩
      success: (res) => {
        //console.log('res: ', res);
        const previewData = res.tempFiles[0]; //得到选择图片的网络地址 http://127.0.0.1:3000/.....IMG917.jpeg
        //上传
        wx.uploadFile({
          url: app.globalData.url + '/uploadPmtHouseHold.do',
          filePath: previewData.tempFilePath , // 本地文件路径
          header: {
            'content-type': 'multipart/form-data',
            'accept': 'application/json',
            "charset": "utf-8"
          },
          name: 'file',
          formData: {
            h_Id: that.data.houseinfodata.h_Id, 
          },
          success: (res) => {
            if(res.statusCode == 200) {
              that.data.houseinfodata.h_Plan=1;
              that.setData({
                houseinfodata:that.data.houseinfodata
              })
            }
          }
        });
      }
    });
  },
  // 删除选平面图
  deleteImg: function() {
    var that=this;
    that.data.houseinfodata.h_Plan=2;
    that.setData({
      houseinfodata:that.data.houseinfodata
    })
  },

  //删除厅室下img  
  removeRoomImg:function(e){
    //recordDatas
    const that = this
    var listindex=e.currentTarget.dataset.listindex; //list 数据的下标
    var avbindex=e.currentTarget.dataset.avbindex;//当前点击的照片下标
    var records=that.data.recordDatas[listindex].list1;

    wx.showModal({
      content:'确定要删除当前照片吗。',
      success:({confirm})=>{
        if(confirm){
            wx.request({
              url: app.globalData.url + '/removeUploadHallRoomPhoto.do',
              method: "POST",
              header: {
                'content-type': 'application/x-www-form-urlencoded'
              },
              data: {
                avb_Id:records[avbindex].avb_Id
              },
              success: function (res) {
                if (res.data.code==200){
                 that.data.recordDatas[listindex].list1[avbindex].avb_Id=0;
                 that.setData({
                    recordDatas: that.data.recordDatas
                  })
                }
                wx.showToast({
                  title: res.data.message,
                  icon: 'none',
                  duration: 2000
                })
              }
            })
        }
      }
    })
  },

  //删除举牌验收img
  removeJupaiRoomImg:function(e){
    //recordDatas
    const that = this
    var records=that.data.jupaiDatas;

    wx.showModal({
      content:'确定要删除当前照片吗。',
      success:({confirm})=>{
        if(confirm){
            wx.request({
              url: app.globalData.url + '/removeUploadHallRoomPhoto.do',
              method: "POST",
              header: {
                'content-type': 'application/x-www-form-urlencoded'
              },
              data: {
                avb_Id:records.avb_Id
              },
              success: function (res) {
                if (res.data.code==200){
                  that.data.jupaiDatas.avb_Id=0;
                  that.setData({
                   jupaiDatas: that.data.jupaiDatas
                  })
                }
                wx.showToast({
                  title: res.data.message,
                  icon: 'none',
                  duration: 2000
                })
              }
            })
        }
      }
    })
  },
// 上传室内验收照片
  UploadImgRoom:function(e){
    const that = this
    var listindex=e.currentTarget.dataset.listindex; //list 数据的下标
    var avbindex=e.currentTarget.dataset.avbindex;//当前点击的照片下标
    var data=that.data.recordDatas[listindex].list1[avbindex];
    wx.chooseMedia({
      mediaType: 'image',
      sourceType: ["album", "camera"], // PC端无效
      count: 1,//最多可选择的图片数量
      sizeType: ["original"], //不图片压缩
      success: (res) => {
          const previewData = res.tempFiles[0]; //得到选择图片的网络地址 http://127.0.0.1:3000/.....IMG917.jpeg
          //照片md5值
          wx.getFileSystemManager().readFile({
            filePath:  previewData.tempFilePath, //选择图片返回的相对路径
            // encoding: 'binary', //编码格式
            success: res => {
              //成功的回调
              //console.log('data:image/png;base64,' , res)
              var spark = new sMD5.ArrayBuffer();
              spark.append(res.data);
              var md5Key = spark.end(false);
              var ctp_Id=data.ctp_Id;//上传部位id
              var cth_Id=data.cth_Id;//上传部位所属分类
              that.uploadFileBefor(md5Key,2, that.data.houseinfodata.h_Project, that.data.sjcurrent+1 ,ctp_Id,cth_Id ,previewData.tempFilePath ,previewData.size,"");
            }
          })
      }
    });
  },
  //上传举牌验收文件
  UploadJupaiRoom:function(){
    const that = this
    wx.chooseMedia({
      mediaType: 'image',
      sourceType: ["album", "camera"], // PC端无效
      count: 1,//最多可选择的图片数量
      sizeType: ["original"], //不图片压缩
      success: (res) => {
          const previewData = res.tempFiles[0]; //得到选择图片的网络地址 http://127.0.0.1:3000/.....IMG917.jpeg
          //照片md5值
          wx.getFileSystemManager().readFile({
            filePath:  previewData.tempFilePath, //选择图片返回的相对路径
            // encoding: 'binary', //编码格式
            success: res => {
              //成功的回调
              //console.log('data:image/png;base64,' , res)
              var spark = new sMD5.ArrayBuffer();
              spark.append(res.data);
              var md5Key = spark.end(false);
              var ctp_Id=null;//上传部位id    举牌验收时 传null
              var cth_Id=null;//上传部位所属分类  举牌验收时 传null
              that.uploadFileBefor(md5Key,2, that.data.houseinfodata.h_Project, that.data.sjcurrent+3 ,ctp_Id,cth_Id ,previewData.tempFilePath ,previewData.size,"");
            }
          })
      }
    });
  },
  //上传pdf
  UploadPdfFileRoom:function(){
    const that = this
    if(that.data.pdfDatas.length>0){
      wx.showModal({
        content:'您已上传过文件，继续上传将会覆盖掉原文件',
        success:({confirm})=>{
          if(confirm){
            that.UploadPdfFileAgain();
          }
        }
      });
    }else{
      that.UploadPdfFileAgain();
    }
  },
  //纸质文件上传（pdf）
  UploadPdfFileAgain:function(){
      const that = this
      wx.chooseMessageFile({
        type: 'file',
        count: 1,//最多可选择pdf数量
        success: (res) => {
            const previewData = res.tempFiles[0]; //得到选择图片的网络地址 http://127.0.0.1:3000/.....IMG917.jpeg
            if(previewData.name.indexOf(".pdf")<1){
              wx.showToast({
                title: '仅支持pdf格式',
                icon: 'error',
                duration: 2000
              });
              return;
            };
            //照片md5值
            wx.getFileSystemManager().readFile({
              filePath:  previewData.path, //选择图片返回的相对路径
              // encoding: 'binary', //编码格式
              success: res => {
                //成功的回调
                //console.log('data:image/png;base64,' , res)
                var spark = new sMD5.ArrayBuffer();
                spark.append(res.data);
                var md5Key = spark.end(false);
                that.uploadFileBefor(md5Key,1, that.data.houseinfodata.h_Project, that.data.bgcurrent+1 ,0,0,previewData.path, previewData.size,previewData.name);
              }
            })
        }
      });
  },
 /**
     * 文件上传前置接口
     * @param md5Str  文件md5值
     * @param uploadtype  1、文件（pdf）上传  2、声像上传
     * @param spId  工程id
     * @param hallId  纸质文件上传时为住户id(h_id)  声像上传时为厅室id（hr_id）
     * @param type    pdf文件上传时不判断  声像上传时为厅室上传文件的类型1、主体图 2、竣工图
     * 
     * @param filePath  需要上传文件信息  filePath本地地址  文件上传前置接口成功后才引用
     * @param ctp_Id  当前文件对应的下标  0、1、2、3     声像上传时为厅室id（hr_id）时才用到     pdf上传不需要
     * @param ctp_Id cth_Id
     * @param fileSize 文件大小
     */
  uploadFileBefor:function(md5Key,uploadtype,spId,type,ctp_Id,cth_Id,filePath,fileSize,fileName){
    wx.showToast({
      title: '正在上传文件，请稍等',
      icon: 'none',
      duration: 2000
    });
    var that = this;
    wx.request({
      url: app.globalData.url + '/addHousefile.do',
      method: "POST",
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      data: {
         uploadtype: uploadtype,
         md5Str: md5Key,
         hallId: that.data.houseinfodata.h_Id, 
         spId: spId,
         type: type
      },
      success: function (res) {
        if (res.data.filestate == 1){
            that.uploadFileContent(md5Key,uploadtype,spId,type,ctp_Id,cth_Id,filePath,fileSize,fileName);
        }else{
          wx.showToast({
            title: res.data.info,
            icon: 'none',
            duration: 2000
          })
        }
      }
    })
  },

  //上传文件
  uploadFileContent:function(md5Key,uploadtype,spId,type,ctp_Id,cth_Id,filePath,fileSize,fileName){
        var that = this;
        //上传
        wx.uploadFile({
          url: app.globalData.url + '/recordHouseUpload.do',
          filePath:filePath, // 本地文件路径
          header: {
            'content-type': 'multipart/form-data',
            'accept': 'application/json',
            "charset": "utf-8"
          },
          name: 'file',
          formData: {
            //h_Id: that.data.houseinfodata.h_Id, 
            md5Key:md5Key,
            name:fileName
          },
          success: (res) => {
            var json=JSON.parse(res.data);
            if(json.success) {
              if(fileName==null || fileName==''){
                fileName=json.data;
              }
              that.uploadFileEnd(md5Key,uploadtype,spId,type,ctp_Id,cth_Id,fileName,fileSize);
            }
          }
        });
  },
  /**
     * 文件上传 完成之后合并文件
     * @param uploadtype  1、文件（pdf）上传  2、声像上传
     * @param spId  工程id
     * @param hallId  文件上传时为住户id  声像上传时为厅室id
     * @param md5Str  文件md5值
     * @param type    pdf文件上传时不判断  声像上传时为厅室上传文件的类型1、主体图 2、竣工图
     * 
     * @param fileSize  需要上传文件的大小
    *  @param hallindex  当前文件对应的下标  0、1、2、3     声像上传时为厅室id（hr_id）时才用到     pdf上传不需要
    *  @param filename 文件名
     */
    uploadFileEnd:function(md5Key,uploadtype,spId,type,ctp_Id,cth_Id,filename,fileSize){
      var that = this 
      wx.request({
        url: app.globalData.url + '/mergeHouseRecordfile.do',
        method: "POST",
        header: {
          'content-type': 'application/x-www-form-urlencoded'
        },
        data: {
           uploadtype: uploadtype,
           type: type,
           ctp_Id:ctp_Id,
           cth_Id:cth_Id,
           md5Key: md5Key,
           fileName:filename,
           h_Id: that.data.houseinfodata.h_Id, 
           spId: spId,
           fileSize:fileSize,
           record_Lrr: wx.getStorageSync("nickName")
        },
        success: function (res) {
          if (res.data.success){
             if(uploadtype==1){
                if(that.data.pdfDatas.length>0){
                  that.delRoomPdfFile();
                }else{
                  that.getPdfInfoData();
                }
             }else{
              that.getRoomInfoData();
             }
          }
          wx.showToast({
            title: res.data.info,
            icon: 'none',
            duration: 2000
          })
        }
      })
    },
    //删除厅室
  delRoomInfo:function(e){
      var that=this;
      var dataindex=e.currentTarget.dataset.dataindex;//作为取 点击的那个厅室的下标 取hr_Id
      wx.showModal({
        content:'确定要删除"'+that.data.recordDatas[dataindex].hr_Name+'"吗，删除之后信息及文件记录将不可恢复。',
        success:({confirm})=>{
          if(confirm){
              wx.request({
                url: app.globalData.url + '/deleteHallRoom.do',
                method: "POST",
                header: {
                  'content-type': 'application/x-www-form-urlencoded'
                },
                data: {
                  hr_Id: that.data.recordDatas[dataindex].hr_Id 
                },
                success: function (res) {
                  if (res.data.code==200){
                    that.getRoomInfoData();
                  }
                  wx.showToast({
                    title: res.data.message,
                    icon: 'none',
                    duration: 2000
                  })
                }
              })
          }
        }
      })
  },

  //添加厅室 显示窗口
  modalinput: function() {
    this.setData({
        hiddenmodalput: !this.data.hiddenmodalput
    })
  },
  //取消按钮  关闭窗口
  cancel: function() {
      this.setData({
          hiddenmodalput: true
      });
  },
  roomNameInput: function (e) {
    this.data.addRoomName = e.detail.value;
  },

  //添加厅室 确认 
  confirm: function() {
    var  that=this;
    wx.request({
      url: app.globalData.url + '/insertHallRoom.do',
      method: "POST",
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      data: {
        hr_HouseHoldId: that.data.houseinfodata.h_Id,
        hr_Name: this.data.addRoomName
      },
      success: function (res) {
        if (res.data.code==200){
          that.getRoomInfoData();
          that.setData({
            hiddenmodalput: true,
            addRoomName:""
          })
        }
        wx.showToast({
          title: res.data.message,
          icon: 'none',
          duration: 2000
        })
      }
    })
  },


//删除户内上传的pdf文件
delRoomPdfFile:function(e){
      var that=this;
      wx.request({
          url: app.globalData.url + '/deleteHallRoomPdfFile.do',
          method: "POST",
          header: {
            'content-type': 'application/x-www-form-urlencoded'
          },
          data: {
            recordId: +that.data.pdfDatas[0].record_Id 
          },
          success: function (res) {
            if (res.data.code==200){
              that.getPdfInfoData();
            }else{
              that.getPdfInfoData();
              wx.showToast({
                title: "合并文件出现异常，请刷新查看",
                icon: 'none',
                duration: 2000
              })
            }
          }
        })
  },
  //导出pdf
  exportPdfBg:function(){
    var that=this;
    var msg
    if(that.data.sjcurrent==0){
      msg='主体验收报告';
    }else{
      msg='竣工验收报告';
    }
    wx.showToast({
      title: '导出文件较大，请耐心等待',
      icon: 'none',
      duration: 2000
    })
    wx.showModal({
      content:'确定要导出'+msg+'吗',
      success:({confirm})=>{
        if(confirm){
          wx.downloadFile({
            url: app.globalData.url + '/exportHouseHoldDataPdf.do?guid='+that.data.guid+'&acceptanceType='+that.data.sjcurrent+1, //仅为示例，并非真实的资源
            filePath: wx.env.USER_DATA_PATH +'/'+msg+'.pdf',//自定义文件地址
            success (res) {
              // 只要服务器有响应数据，就会把响应内容写入文件并进入 success 回调，业务需要自行判断是否下载到了想要的内容
              if (res.statusCode === 200) {
                var filePath = res.filePath
                wx.openDocument({//打开
                  filePath: filePath,
                  showMenu:true,   
                  success: function (res) {}
                })
              }
            }
          })
        }
      }
      })
  },
  getComonUrl:function(type,avb_SliceName,fileId,index){
    if(type==1){
      if(avb_SliceName==null || avb_SliceName ==undefined || avb_SliceName=="" || fileId==null || fileId ==undefined || fileId==""){
        return "";
      }
      return app.globalData.fileUrl+"/avarch/"+avb_SliceName+"/source/"+fileId+"/"+fileId+"-shuiyin.jpg?"+ Date.parse(new Date());
    }else if(type==2){
      if(avb_SliceName==null || avb_SliceName ==undefined || avb_SliceName==""){
        return "";
      }
      return app.globalData.fileUrl+"/singleProjectPath/houseHold/pmt"+avb_SliceName+".jpg?"+ Date.parse(new Date());
    }else if(type==3){
      if(avb_SliceName==null || avb_SliceName ==undefined || avb_SliceName=="" || fileId==null || fileId ==undefined || fileId==""){
        return "";
      }
      return app.globalData.fileUrl+"/eaorsPath/"+avb_SliceName+"/source/"+fileId+"/"+fileId+"-"+index+".png";
    }
  },
/**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },
  
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },


  
})